Plotting Volumes of Revolution in 3D

To display the volumes of revolution in three dimensions we express the points on the surface using a parametric form of equations for x, y, and z. Normally we express a function of two variables as

z = z(x, y)

But for our plotting we instead use

x = x(r, θ)
y = y(r, θ)
z = z(r, θ)

where r and θ are called parameters. This form plots the Cartesians coordinates x, y, and z as dependent variables for the cylindrical coordinates r and θ. Cylindrical coordinates are particularly appropriate for plotting volumes of revolution because the volume that is generated has rotational symmetry about the axis of rotation. So to plot this we always define the axis of rotation to be the z axis in cylindrical coordinates and transform the x, y and z coordinates in the Cartesian system accordingly.

For the x-axis rotation use:

x = r
y = f(r)·cos(θ)
z = f(r)·sin(θ)
r ∈ [0, N]
θ ∈ [0, 2·π]

and for the y-axis rotation use:

x = r·cos(θ)
y = r·sin(θ)
z = f(r)
r ∈ [0, N]
θ ∈ [0, 2·π]

In both cases, [0, N] is desired range for x